Microprocessors, microcomputers and larger computers frequently utilize a peripheral device or a built-in circuit known as a Real Time Clock (RTC) plus RAM circuit (RTC RAM). Such a part typically provides complete time of day and long term calendar information, as well as critical system constants for use in the computer Generally, a Real Time Clock is operated from the primary computer power supply. In addition, the RTC is provided with battery back-up; so that the timekeeping and calendar functions of the clock are not lost in the event that the main power is turned off or interrupted. Two popular peripheral RTC devices for providing such functions are the Motorola MC146818A and the Dallas Semiconductor DS1287. These parts are widely used with popular personal computers made by various manufacturers.
Whether an RTC RAM device is supplied as a peripheral device or is otherwise built into the computer, the processor program for the computer obtains the time and calendar information, and other critical system constants, from the Random Access Memory (RAM) of the RTC device by reading the appropriate address locations in the device in accordance with the processor program. In addition, it is necessary for a provision to be made in the program for initializing or changing the time, calendar and other critical system constants of the RTC device by writing these to various RAM address locations.
Once the information has been initialized, changes are not frequently made by writing to the RTC RAM address location; but updates or writing of new information into the various RTC memory locations can occur at anytime during the operation of the computer. So long as the computer and RTC device are operating under constant power, there is no problem with such writing of information to the RAM address locations in the device.
In the design of RTC devices, special consideration has been given to avoiding data corruption of the battery-backed RAM in such devices by uncontrolled activity on the microprocessor bus during periods of power supply interruption. In normal unprotected designs, the combination of the write strobe and a chip select (RTC select) signal causes data on the data bus of the microprocessor to be written into a destination dictated by the address bus. If the power supply is dropping or turning off during a write access, erroneous data can be written to the destination in the RTC RAM, or data can be written to the wrong destination. Furthermore, if no control is maintained over the address, a number of address locations could be corrupted. Such a situation can occur during power interruption or if the computer processor loses control of its instruction sequence.
In the past, attempts to solve this problem of power supply interruption have incorporated a sensing circuit for producing a "stand-by" or "power-down" mode which prohibits a data transfer whenever this mode is activated. This usually is effected by an off-chip sensor which reflects the integrity of the power supply and directly monitors that power supply. While such a "stand-by" mode of operation is adequate to protect against erroneous data or erroneous addresses for stable power-down situations, no protection is provided against data corruption which can occur in the event the stand-by mode becomes active during a data transfer cycle which already is underway at the time power is interrupted. Such a situation typically results in an aborted write cycle and causes invalid data to be written to the destination address, because the pulse-width or data hold specifications for proper operation of the RTC device are not maintained.
Accordingly, it is desirable to provide address and data protection for an RTC RAM during all power supply modes of operation of the computer with which the device is associated including power-on, power-off, and transient periods of power interruption.